

import { ADD } from "./types"
const defautState = {
    num: 0
}

export default (state = defautState, action) => {
    console.log(state);
    let newState = JSON.parse(JSON.stringify(state))
    switch (action.type) {
        case ADD:
            newState.num += action.value
            return newState

        default:
            return newState
    }
}